﻿using System;
using System.Collections.Generic;
using System.Text;
using Google.Protobuf;
using Cemit.PolyProto;

namespace Cemit.PolyServer.Lobby
{
    class JoinMatchHandle : IMessageHandle<Msg_Lobby_JoinMatch>
    {
        public void Execute(ClientState clientState, IMessage message)
        {
            if (!clientState.IsLogin)
            {
                this.LogWarning("加入房间失败, 玩家还未登录: " + clientState.ToInfoString());
                return;
            }

            clientState.player.JoinMatch(
                (short)this.AsMessage(message).FullNumber);

            //((LobbyServer)clientState.server)
            //    .JoinMatch(clientState.player, (short)this.AsMessage(message).FullNumber);
        }
    }
}
